package lab9.com.acme.bankapp.domain.bank;

public class Client
{
	private Account[] accounts;
	private int numberOfAccounts;
	private int maxNumberOfAccounts;
	private String name;
	private Gender gender;
	
	public Client(String clientName, Gender clientSex, 
			final int accountsQuantity)
	{
		name = clientName;
		gender = clientSex;
		maxNumberOfAccounts = accountsQuantity;
		accounts = new Account[maxNumberOfAccounts];
	}
	
	public Client(final int accountsNumber)
	{
		this("<NAME>", Gender.MALE, accountsNumber);
	}
	
	public void addAccount(final Account newAccount)
	{
		accounts[numberOfAccounts] = newAccount;
		numberOfAccounts++;
	}
	
	public Account[] getAccounts()
	{
		return accounts;
	}
	
	public int getNumberOfAccounts()
	{
		return numberOfAccounts;
	}
	
	public void setClientName(String clientName)
	{
		name = clientName;
	}
	
	public void getClientSalutation()
	{
		System.out.println(gender.getSalutation() + ' ' + name);
	}
	
}
